<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{padding: 0;margin: 0;box-sizing: border-box;}
        .box{
            width: 400px;
            height: 400px;
            margin: 100px auto;
            background-color: #ddd;
            display: flex;
            /* 1.主轴沿着水平方向,起点在左侧,默认值 */
            -flex-direction: row;
            -flex-direction: row-reverse;
            -flex-direction: column;
            flex-direction: column-reverse;
        }
        .item{
            height: 30px;
            color: #fff;
            text-align: center;
            border-right:1px solid #fff;
            background-color: #f40;
            font-size:20px;
            flex:1;
            /* //子项目占据父容器的空间,说明均分 */
        }
    </style>
</head>
<body>
    <div class="box">
        <div class="item">1</div>
        <div class="item">2</div>
        <div class="item">3</div>
        <div class="item">4</div>
    </div>
</body>
</html>